Skip to main content
ICT
Lesson A8 - Control Structures
 
Main Previous Next
Title Page >  
Summary >  
Lesson A1 >  
Lesson A2 >  
Lesson A3 >  
Lesson A4 >  
Lesson A5 >  
Lesson A6 >  
Lesson A7 >  
Lesson A8 >  
Lesson A9 >  
Lesson A10 >  
Lesson A11 >  
Lesson A12 >  
Lesson A13 >  
Lesson A14 >  
Lesson A15 >  
Lesson A16 >  
Lesson A17 >  
Lesson A18 >  
Lesson A19 >  
Lesson A20 >  
Lesson A21 >  
Lesson A22 >  
Lesson AB23 >  
Lesson AB24 >  
Lesson AB25 >  
Lesson AB26 >  
Lesson AB27 >  
Lesson AB28 >  
Lesson AB29 >  
Lesson AB30 >  
Lesson AB31 >  
Lesson AB32 >  
Lesson AB33 >  
Vocabulary >  
 

A. Structured Programming page 3 of 17

  1. In the early days of programming (1960's), the approach to writing software was relatively primitive and ineffective. Much of the code was written with goto statements that transferred program control to another line in the code. Tracing this type of code was an exercise in jumping from one spot to another, leaving behind a trail of lines similar to spaghetti. The term "spaghetti code" comes from trying to trace code linked together with goto statements. The complexity this added to code led to the development of structured programming.

  2. The research of Bohm and Jacopini has led to the rules of structured programming. Here are five tenets of structured programming.

    1. No goto statements are to be used in writing code.
    2. All programs can be written in terms of three control structures: sequence, selection, and iteration.
    3. Each control structure has one entrance point and one exit point. We will sometimes allow for multiple exit points from a control structure using the break statement.
    4. Control structures may be stacked (sequenced) one after the other.
    5. Control structures may be nested inside other control structures.


  3. The control structures of Java encourage structured programming. Staying within the guidelines of structured programming has led to great productivity gains in the field of software engineering.

 

Main Previous Next
Contact
 © ICT 2006, All Rights Reserved.